package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpVideoHisDTO;
import com.financing.wap.service.IFpVideoHisService;
import com.financing.wap.dao.IFpVideoHisDao;
/**
 * fp_video_his  
 * 路演视频记录表 业务访问层实现类
 * @author lisu
 *
 */
 
@Repository("fpVideoHisService")
public class FpVideoHisServiceImpl implements IFpVideoHisService{

	@Autowired
	private IFpVideoHisDao fpVideoHisDao;

	@Override
	public int insert(FpVideoHisDTO fpVideoHis) throws SQLException {
		return fpVideoHisDao.insert(fpVideoHis);
	}

	@Override
	public void update(FpVideoHisDTO fpVideoHis) throws SQLException {
		fpVideoHisDao.update(fpVideoHis);
	}

	@Override
	public void updateForce(FpVideoHisDTO fpVideoHis) throws SQLException {
		fpVideoHisDao.updateForce(fpVideoHis);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpVideoHisDao.delete(id);
	}
	
	@Override
	public List<FpVideoHisDTO> queryList(FpVideoHisDTO fpVideoHis) throws SQLException {
		return fpVideoHisDao.queryList(fpVideoHis);
	}

	@Override
	public int queryListCount(FpVideoHisDTO fpVideoHis) throws SQLException {
		return fpVideoHisDao.queryListCount(fpVideoHis);
	}

	@Override
	public FpVideoHisDTO loadById(Integer id) throws SQLException {
		return fpVideoHisDao.loadById(id);
	}
 	@Override
	public FpVideoHisDTO queryListGetFirst(FpVideoHisDTO fpVideoHis)
			throws SQLException {
		 List<FpVideoHisDTO> queryList = queryList(fpVideoHis);
		 if(queryList==null||queryList.size()==0){
			 return new FpVideoHisDTO();
		 }
		 return queryList.get(0);
	}
}
